import request from '@/utils/request'
//新增字段
export const addField = (name, type) => {
  return request({
    url: '/equipment/field',
    method: 'put',
    params: {
      name: name,
      type: type,
    }
  })
}
// 修改字段
export const editField = (id, name, type) => {
  return request({
    url: '/equipment/field/edit',
    method: 'put',
    data: {
      id: id,
      name: name,
      type: type,
    }
  })
}
// 删除字段
export const delField = (id) => {
  return request({
    url: '/equipment/field/' + `${id}`,
    method: 'delete'
  })
}
// 获取字段
export const getField = (id, name, type) => {
  return request({
    url: '/equipment/field',
    method: 'post',
    data: {
      id: id,
      name: name,
      type: type,
    }
  })
}